package de.hs_mannheim.visualscheduler.scheduling;

import java.util.ArrayList;

/**
 * The Class FirstComeFirstServed implements the FCFS algorithm.
 */
public class FirstComeFirstServed extends AbstractScheduler {
	@Override
	protected String getAlgorithmName() {
		return "First-Come First-Served (FCFS)";
	}

	@Override
	protected ScheduleResult performSchedulingBlock(final ArrayList<Process> active) {
		return new ScheduleResult(active.get(0), active.get(0).getTimeleft());
	}

	@Override
	protected void prepareForScheduling(int timeSliceLength) {
	}

	@Override
	protected boolean isPreemptive() {
		return false;
	}
}
